package com.bawei.park2211a

import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import com.alibaba.android.arouter.launcher.ARouter
import com.bawei.base.mvvm.BaseViewActivity
import com.bawei.park2211a.databinding.ActivityGuideBinding
import com.bumptech.glide.Glide
import com.youth.banner.loader.ImageLoader

import java.util.Timer
import java.util.TimerTask

class GuideActivity : BaseViewActivity<ActivityGuideBinding>() {
    lateinit var timer:Timer
    var time=5

    override fun initView() {
        timer=Timer()
        timer.schedule(object :TimerTask(){
            override fun run() {
                time--
                runOnUiThread {
                    binding.time.text="$time s"
                }
                if (time==1){
                    timer.cancel()
                    ARouter.getInstance().build("/app/login/LoginActivity").navigation()
                }
            }

        },500,1000)
        var list= mutableListOf<Int>()
        list.add(R.drawable.d1f0f1fe839199183f22d40ad82e4e52)
        list.add(R.drawable.d1f0f1fe839199183f22d40ad82e4e52)
        list.add(R.drawable.d1f0f1fe839199183f22d40ad82e4e52)
        binding.banner.setImages(list)
            .setImageLoader(object : ImageLoader(){
                override fun displayImage(context: Context?, path: Any?, imageView: ImageView?) {
                    Glide.with(context!!).load(path).into(imageView!!)
                }

            }).start()
    }

    override fun initData() {

    }
}